load("@bazel_skylib//rules:common_settings.bzl", "bool_flag")
load("//bazel:tachyon_cc.bzl", "tachyon_cc_library")

package(default_visibility = ["//visibility:public"])

# We need to change the default value if we change the default rustc version.
bool_flag(
    name = "rustc_version_ge_1.67.0",
    build_setting_default = True,
)

config_setting(
    name = "rustc_version_ge_1.67.0_is_true",
    flag_values = {"rustc_version_ge_1.67.0": "true"},
)

tachyon_cc_library(
    name = "container_util",
    hdrs = ["container_util.h"],
    deps = [
        "//tachyon/base:template_util",
        "//tachyon/base/functional:functor_traits",
        "@com_google_absl//absl/types:span",
        "@cxx.rs//:core",
    ],
)

tachyon_cc_library(
    name = "rust_vec",
    hdrs = ["rust_vec.h"],
    defines = select({
        ":rustc_version_ge_1.67.0_is_true": ["RUSTC_VERSION_GE_1_67_0"],
        "//conditions:default": [],
    }),
    deps = [
        "//tachyon:export",
        "//tachyon/base:logging",
        "//tachyon/base/buffer:copyable",
        "//tachyon/base/strings:string_number_conversions",
        "@com_google_absl//absl/strings",
        "@com_google_absl//absl/types:span",
    ],
)
